<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\Models\Goods;
use Faker\Generator as Faker;

$factory->define(Goods::class, function (Faker $faker) {
   
    $market_price = $faker->numberBetween(100, 999);
    return [
        'name' => $faker->name,
        'sub_title' => $faker->sentence(),
        'cover_img' => "https://i.picsum.photos/id/".random_int(300, 350)."/80/80.jpg",
        'market_price' => $market_price,
        'price' => $market_price * 0.8,
        'stock' => $faker->numberBetween(1, 20),
        'is_hot' => array_rand([0, 1]),
        'is_new' => array_rand([0, 1]),
        'is_recommend' => array_rand([0, 1]),
        'is_index' => array_rand([0, 1]),
        'member_only' => array_rand([0, 1]),
        'virtual_sales' => $faker->numberBetween(0, 100),
        'description' => $faker->text(),
    ];
});
